-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: [WD-14882] Adjust Listen and Connect Inputs #890
Conversation
It would be a nice to have to be able to have hover text on the disabled input for connect when NAT is enabled, however it does not take an onhover param. Any tips here, @edlerd ? Also, @piperdeck , thanks in advance for the design review. The current code structure doesn't quite allow for the nicer look of having the input labels to the left of the input field. Even with the stacked attribute on the inputs, they end up looking indented and out of place. I tried exploring a few different ways to achieve your design but what not quite able. Perhaps some further light might be able to be shed on this by a reviewer... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some ideas on the code simplification.
We need to be closer to the design. The labels should be in the left-hand column and listen/connect are not labels, and in italics.
I'm getting some strange behaviour where my mouse pointer is showing the pointing finger when I hover over the field label. This is different from when I hover over any other field label that isn't on this page: CleanShot.2024-09-15.at.20.56.02.mp4Also noticing that the address fields don't adapt to when Unix is selected as the connection type. Because unix sockets aren't like IP addresses, and they're of the form /path/to/socket.sock, the fields should change when I change the port type: I'm not sure if this is what David is talking about in his previous comment, but when the user set NAT mode to true, the connection types for listen and connect should always be the same. Also, neither one can be Unix if NAT mode is enabled. But that behaviour isn't showing up at the moment: These fields should probably be filled by their default values, rather than by "Select option": I'm also noticing that the mode and UID/GID fields are missing when Unix is selected for the listen address. Did we opt not to include those? |
442730c
to
c445b02
Compare
@piperdeck , thanks for your review. A few comments :)
Note to self: If NAT is enabled, neither Listen nor Connect can be UNIX. |
I think this is default for HTML labels and should be all right from my point of view.
I asked to remove the defaults earlier, because otherwise there is no way for a user to create a proxy device without those values being set. Now I am not so sure. Maybe we should preselect the default values that LXD will enforce? Another thought: Should we remove the HAProxy protocol selector? I am not so sure how relevant it is, have a suspicion it is kind of a special use case thing we might want to hide from the average UI user.
I think Mode, GID and UID are for very special use cases, maybe we can ignore them in the UI to keep the form simple? |
Noted. @piperdeck , how far do you agree with this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One observation from QA
c445b02
to
399e45d
Compare
My concern is that I want the user to actually know what the value of the default is. Like in the Bind field, with it set to Choose option, there's no intuitive way to know whether this configuration is going to bind to the host or the instance (for example). This is a tricky question. Am I understanding correctly that on the back end, there's a difference between implicitly keeping the default value and explicitly setting the default value? In that case, is there any reason for use to ever leave that field implicit, rather than declaring it explicitly? I would lean toward that solution personally.
I'm ok with the behaviour in theory, it's just that it's not consistent with field labels on our other pages. It's setting off alarm bells for me that there's something different in the implementation that might need to be brought back in line. But even if all the code is ok, I think that this kind of consistency is important for maintaining a general feeling of quality Regarding HAproxy and GUI/ID options, if they're really advanced options, I'm ok with reserving them for the YAML editor since we have it. We might have actually discussed this before, apologies if it's just my bad for forgetting :P |
399e45d
to
637d718
Compare
637d718
to
bde1f39
Compare
96495ae
to
1729c79
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks very close to finished now, thanks for that. Some comments below.
1729c79
to
101763e
Compare
101763e
to
bcd8cd7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the adjustments, I found one probably last issue with changing the listen type when nat mode is enabled.
bcd8cd7
to
5947575
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think when switching to bind mode "instance", the NAT mode selector should be disabled with a title explaining "Only host-bound proxies can use NAT". If NAT mode is enabled, we should disable it. If NAT mode was not set, it shouldn't be overridden.
This is another restriction the form should represent. Though, it is much harder to represent. Maybe removing the HAProxy protocol selector is the easiest solution for it. As any other solution I can think of will be hard to understand for the user. And the field seems not so important to me.
@edlerd I'll remove the HAProxy input for now (and add this to the Spec), but isn't the solution just as simple as checking that NAT is disabled? Or is the problem moreso telling the User at the right time that certain configs aren't allowed? |
5947575
to
cf1cc76
Compare
cf1cc76
to
d8b1cee
Compare
There are many special cases here and handling them well is a can of worms. Probably best to avoid this complexity. Some examples:
|
c4b35b2
to
4262f1c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works so well now, good stuff 👍
QA and code LGTM, some very tiny nitpicks on the code, can also merge as is.
Signed-off-by: Nkeiruka <[email protected]>
4262f1c
to
49d5df9
Compare
Done
QA
Screenshots
Updated:
![image](https://private-user-images.githubusercontent.com/58699506/368088143-06181f53-3fc1-41de-a277-12966225b135.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2NTc0MzMsIm5iZiI6MTczOTY1NzEzMywicGF0aCI6Ii81ODY5OTUwNi8zNjgwODgxNDMtMDYxODFmNTMtM2ZjMS00MWRlLWEyNzctMTI5NjYyMjViMTM1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDIyMDUzM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTk5YjRmY2ZiZmQ1ZjQ0N2MxYzkyZDhhNmVhYTU3NWRhOGM0ZGM0NzY0NjgxNzA4ZDE4YWQ3ODQ5YTBkZmIxY2UmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.w8-BT0vrSRR8c6XPZw6ft9cYIjE66bbVD2_T2yO5C8w)